// $ANTLR 3.4 C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g 2012-11-20 19:00:05

package PL.prac9;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class anasint extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "AUTOR", "BARRA", "BLANCO", "CADENA", "COMENTARIO", "COMILLAS", "DIGITO", "END_AUTOR", "END_TITULO", "EXCLAMACION", "GUIONES", "IGUAL", "LETRA", "MAYOR", "MENOR", "NUMERO", "PALABRA", "TITULO"
    };

    public static final int EOF=-1;
    public static final int AUTOR=4;
    public static final int BARRA=5;
    public static final int BLANCO=6;
    public static final int CADENA=7;
    public static final int COMENTARIO=8;
    public static final int COMILLAS=9;
    public static final int DIGITO=10;
    public static final int END_AUTOR=11;
    public static final int END_TITULO=12;
    public static final int EXCLAMACION=13;
    public static final int GUIONES=14;
    public static final int IGUAL=15;
    public static final int LETRA=16;
    public static final int MAYOR=17;
    public static final int MENOR=18;
    public static final int NUMERO=19;
    public static final int PALABRA=20;
    public static final int TITULO=21;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public anasint(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public anasint(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return anasint.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g"; }


      // Al faltar un token, intenta una recuperación de errores llamando a esta función, por lo tanto no lanzaba la excepción y sólo mostraba el error indicándolo.
      // Sobreescribimos la función para que lance de nuevo la excepción y poder capturarla por nuestra cuenta.
      protected Object recoverFromMismatchedToken(IntStream input, int ttype, BitSet follow) throws RecognitionException {
          throw new MismatchedTokenException(ttype, input);
      }
      //Variable que controlará si la regla se encuentra o no antes de un end de etiqueta.
      boolean in;
      int numerrores = 0;
      public int errores () {
        return numerrores;
        }



    // $ANTLR start "entrada"
    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:27:1: entrada : bloque EOF ;
    public final void entrada() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:27:9: ( bloque EOF )
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:27:11: bloque EOF
            {
            pushFollow(FOLLOW_bloque_in_entrada49);
            bloque();

            state._fsp--;


            match(input,EOF,FOLLOW_EOF_in_entrada51); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "entrada"



    // $ANTLR start "bloque"
    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:1: bloque : ( ( etiquetaa linea etiquetac ) | ( TITULO linea END_TITULO AUTOR linea END_AUTOR ) );
    public final void bloque() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:8: ( ( etiquetaa linea etiquetac ) | ( TITULO linea END_TITULO AUTOR linea END_AUTOR ) )
            int alt1=2;
            int LA1_0 = input.LA(1);

            if ( (LA1_0==MENOR) ) {
                alt1=1;
            }
            else if ( (LA1_0==TITULO) ) {
                alt1=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 1, 0, input);

                throw nvae;

            }
            switch (alt1) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:10: ( etiquetaa linea etiquetac )
                    {
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:10: ( etiquetaa linea etiquetac )
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:11: etiquetaa linea etiquetac
                    {
                    pushFollow(FOLLOW_etiquetaa_in_bloque59);
                    etiquetaa();

                    state._fsp--;


                    pushFollow(FOLLOW_linea_in_bloque61);
                    linea();

                    state._fsp--;


                    pushFollow(FOLLOW_etiquetac_in_bloque63);
                    etiquetac();

                    state._fsp--;


                    }


                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:40: ( TITULO linea END_TITULO AUTOR linea END_AUTOR )
                    {
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:40: ( TITULO linea END_TITULO AUTOR linea END_AUTOR )
                    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:28:41: TITULO linea END_TITULO AUTOR linea END_AUTOR
                    {
                    match(input,TITULO,FOLLOW_TITULO_in_bloque69); 

                    pushFollow(FOLLOW_linea_in_bloque71);
                    linea();

                    state._fsp--;


                    match(input,END_TITULO,FOLLOW_END_TITULO_in_bloque73); 

                    match(input,AUTOR,FOLLOW_AUTOR_in_bloque75); 

                    pushFollow(FOLLOW_linea_in_bloque77);
                    linea();

                    state._fsp--;


                    match(input,END_AUTOR,FOLLOW_END_AUTOR_in_bloque79); 

                    }


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "bloque"



    // $ANTLR start "linea"
    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:1: linea : ( PALABRA | bloque )* ;
    public final void linea() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:7: ( ( PALABRA | bloque )* )
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:9: ( PALABRA | bloque )*
            {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:9: ( PALABRA | bloque )*
            loop2:
            do {
                int alt2=3;
                switch ( input.LA(1) ) {
                case MENOR:
                    {
                    int LA2_1 = input.LA(2);

                    if ( (LA2_1==PALABRA) ) {
                        alt2=2;
                    }


                    }
                    break;
                case PALABRA:
                    {
                    alt2=1;
                    }
                    break;
                case TITULO:
                    {
                    alt2=2;
                    }
                    break;

                }

                switch (alt2) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:10: PALABRA
            	    {
            	    match(input,PALABRA,FOLLOW_PALABRA_in_linea88); 

            	    }
            	    break;
            	case 2 :
            	    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:29:18: bloque
            	    {
            	    pushFollow(FOLLOW_bloque_in_linea90);
            	    bloque();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "linea"



    // $ANTLR start "etiquetaa"
    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:30:1: etiquetaa : MENOR PALABRA MAYOR ;
    public final void etiquetaa() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:30:11: ( MENOR PALABRA MAYOR )
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:30:13: MENOR PALABRA MAYOR
            {
            match(input,MENOR,FOLLOW_MENOR_in_etiquetaa99); 

            match(input,PALABRA,FOLLOW_PALABRA_in_etiquetaa101); 

            match(input,MAYOR,FOLLOW_MAYOR_in_etiquetaa103); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "etiquetaa"



    // $ANTLR start "etiquetac"
    // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:31:1: etiquetac : MENOR BARRA PALABRA MAYOR ;
    public final void etiquetac() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:31:11: ( MENOR BARRA PALABRA MAYOR )
            // C:\\Users\\Jose\\workspace\\prac9\\src\\main\\java\\PL\\prac9\\anasint.g:31:13: MENOR BARRA PALABRA MAYOR
            {
            match(input,MENOR,FOLLOW_MENOR_in_etiquetac111); 

            match(input,BARRA,FOLLOW_BARRA_in_etiquetac113); 

            match(input,PALABRA,FOLLOW_PALABRA_in_etiquetac115); 

            match(input,MAYOR,FOLLOW_MAYOR_in_etiquetac117); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "etiquetac"

    // Delegated rules


 

    public static final BitSet FOLLOW_bloque_in_entrada49 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entrada51 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_etiquetaa_in_bloque59 = new BitSet(new long[]{0x0000000000340000L});
    public static final BitSet FOLLOW_linea_in_bloque61 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_etiquetac_in_bloque63 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TITULO_in_bloque69 = new BitSet(new long[]{0x0000000000341000L});
    public static final BitSet FOLLOW_linea_in_bloque71 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_END_TITULO_in_bloque73 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_AUTOR_in_bloque75 = new BitSet(new long[]{0x0000000000340800L});
    public static final BitSet FOLLOW_linea_in_bloque77 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_END_AUTOR_in_bloque79 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PALABRA_in_linea88 = new BitSet(new long[]{0x0000000000340002L});
    public static final BitSet FOLLOW_bloque_in_linea90 = new BitSet(new long[]{0x0000000000340002L});
    public static final BitSet FOLLOW_MENOR_in_etiquetaa99 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_PALABRA_in_etiquetaa101 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_MAYOR_in_etiquetaa103 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_MENOR_in_etiquetac111 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_BARRA_in_etiquetac113 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_PALABRA_in_etiquetac115 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_MAYOR_in_etiquetac117 = new BitSet(new long[]{0x0000000000000002L});

}